package com.ubo.main;

import javafx.application.Application;
import javafx.geometry.Rectangle2D;
import javafx.scene.Scene;
import javafx.stage.Screen;
import javafx.stage.Stage;

/**
 * 
 * @author Guillaume
 *
 */
public class MainAppli extends Application{

	@Override
	public void start(Stage primaryStage) throws Exception {
		MainView mainView = new MainView();
		Scene newScene = new Scene(mainView.getMainPane());
		mainView.getMainPane().prefWidthProperty().bind(newScene.widthProperty());
		mainView.getMainPane().prefHeightProperty().bind(newScene.heightProperty());
		newScene.getStylesheets().add(getClass().getResource("segmented.css").toExternalForm());
		primaryStage.setScene(newScene);
		
		Screen screen = Screen.getPrimary();
		Rectangle2D bounds = screen.getVisualBounds();

		primaryStage.setX(bounds.getMinX());
		primaryStage.setY(bounds.getMinY());
		primaryStage.setWidth(bounds.getWidth());
		primaryStage.setHeight(bounds.getHeight());
		primaryStage.show();
	}
	
	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Application.launch(args);
	}

}
